package oocl.ita.eordering.vo;

import java.text.SimpleDateFormat;
import java.util.List;

import oocl.ita.eordering.po.Order;

public class Vorder extends Order {
	private List<Vfood> foodlist;
	private int oStatusString;
	private String status_msg;
	private String date_msg; 
	private SimpleDateFormat formatter;
	private String merchant_name;
	
	public String getMerchant_name() {
		return merchant_name;
	}

	public void setMerchant_name(String merchant_name) {
		this.merchant_name = merchant_name;
	}

	public String getDate_msg() {
		return date_msg;
	}

	public void setDate_msg(String date_msg) {
		this.date_msg = date_msg;
	}

	public String getStatus_msg() {
		return status_msg;
	}

	public void setStatus_msg(String status_msg) {
		this.status_msg = status_msg;
	}

	public int getoStatusString() {
		return oStatusString;
	}

	public void setoStatusString(int oStatusString) {
			formatter=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		switch (oStatusString) {
		case 1:
			status_msg="待接订单";

			date_msg = "开始时间 ： "+formatter.format(this.getStartTime());
			break;
		case 2:
			status_msg="已接订单";
			date_msg = "确认时间 ： "+formatter.format(this.getConfirmTime());
			break;
		case 3:
			status_msg="订单完成";
			date_msg = "完成时间 ： "+formatter.format(this.getFinishTime());
			break;
		case 4:
			status_msg="拒绝订单";
			date_msg = "完成时间 ： "+formatter.format(this.getFinishTime());
			break;
		default:
			status_msg="错误订单";
			date_msg = "wrong status";
			break;
		}
		
	}

	public Vorder(Order order) {
		super();
		this.setoId(order.getoId());
		this.setcId(order.getcId());
		this.setmId(order.getmId());
		this.setFoodInfo(order.getFoodInfo());
		this.setoStatus(order.getoStatus());
		this.setStartTime(order.getStartTime());
		this.setConfirmTime(order.getConfirmTime());
		this.setFinishTime(order.getFinishTime());
		this.setoStark(order.getoStark());
		this.setComplaint(order.getComplaint());
		setoStatusString(order.getoStatus());
	}

	public Vorder() {
		// TODO Auto-generated constructor stub
	}

	public List<Vfood> getFoodlist() {
		return foodlist;
	}

	public void setFoodlist(List<Vfood> foodlist) {
		this.foodlist = foodlist;
	}

}
